<?php

namespace app\api\controller;


use app\admin\model\Users as ADMIN_U;

class Users extends Base
{

    public function state()
    {
        $my_self = session('my_self');
        if (empty($my_self)) {
            $id      = '2';
            $m       = new ADMIN_U();
            $my_self = (Array)$m->getById($id);
        }
        return js_return(1, 'msg', $my_self);
    }

    public function updatemap()
    {
        $my_self = session('my_self');
        $m       = new ADMIN_U();
        if (empty($my_self)) {
            $id      = '2';
            $my_self = (Array)$m->getById($id);
        }
        $opt = input_db_allowed('centerpoint,zoom');
        $s = $m->save($opt," id='{$my_self['id']}' ");
        if($s){
            return js_return(1,'success',$s);
        }else{
            return js_return(0,'error',$s);
        }
    }
}
